home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / Dictionary.a < prev    next >
Encoding:
Text File  |  1998-02-12  |  5.6 KB  |  189 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Dictionary.a
  3. ;
  4. ;    Contains:    Dictionary Manager Interfaces
  5. ;
  6. ;    Version:    Technology:    System 7
  7. ;                Release:    Universal Interfaces 3.1
  8. ;
  9. ;    Copyright:    © 1992-1998 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__DICTIONARY__') = 'UNDEFINED' THEN
  19. __DICTIONARY__ SET 1
  20.  
  21.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  22.     include 'MacTypes.a'
  23.     ENDIF
  24.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  25.     include 'Files.a'
  26.     ENDIF
  27.  
  28.  
  29.  
  30.                                                             ; Dictionary data insertion modes 
  31. kInsert                            EQU        0                    ; Only insert the input entry if there is nothing in the dictionary that matches the key. 
  32. kReplace                        EQU        1                    ; Only replace the entries which match the key with the input entry. 
  33. kInsertOrReplace                EQU        2                    ; Insert the entry if there is nothing in the dictionary which matches the key, otherwise replaces the existing matched entries with the input entry. 
  34. ;  This Was InsertMode 
  35. ; typedef short                         DictionaryDataInsertMode
  36.  
  37.  
  38.                                                             ; Key attribute constants 
  39. kIsCaseSensitive                EQU        $10                    ; case sensitive = 16        
  40. kIsNotDiacriticalSensitive        EQU        $20                    ; diac not sensitive = 32    
  41.  
  42.                                                             ; Registered attribute type constants.    
  43. kNoun                            EQU        -1
  44. kVerb                            EQU        -2
  45. kAdjective                        EQU        -3
  46. kAdverb                            EQU        -4
  47. ;  This Was AttributeType 
  48. ; typedef SInt8                         DictionaryEntryAttribute
  49.  
  50. ;  Dictionary information record 
  51. DictionaryInformation    RECORD 0
  52. dictionaryFSSpec         ds        FSSpec            ; offset: $0 (0)
  53. numberOfRecords             ds.l    1                ; offset: $46 (70)
  54. currentGarbageSize         ds.l    1                ; offset: $4A (74)
  55. script                     ds.w    1                ; offset: $4E (78)
  56. maximumKeyLength         ds.w    1                ; offset: $50 (80)
  57. keyAttributes             ds.b    1                ; offset: $52 (82)
  58.                          ORG 84
  59. sizeof                     EQU *                    ; size:   $54 (84)
  60.                         ENDR
  61. DictionaryAttributeTable RECORD 0
  62. datSize                     ds.b    1                ; offset: $0 (0)
  63. datTable                 ds.b    1                ; offset: $1 (1) <-- really an array of length one
  64. sizeof                     EQU *                    ; size:   $2 (2)
  65.                         ENDR
  66. ; typedef struct DictionaryAttributeTable * DictionaryAttributeTablePtr
  67.  
  68. ;
  69. ; pascal OSErr InitializeDictionary(const FSSpec *theFsspecPtr, SInt16 maximumKeyLength, SInt8 keyAttributes, ScriptCode script)
  70. ;
  71.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  72.         Macro
  73.         _InitializeDictionary
  74.             move.w              #$0500,D0
  75.             dc.w                $AA53
  76.         EndM
  77.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  78.         IMPORT_CFM_FUNCTION InitializeDictionary
  79.     ENDIF
  80.  
  81. ;
  82. ; pascal OSErr OpenDictionary(const FSSpec *theFsspecPtr, SInt8 accessPermission, SInt32 *dictionaryReference)
  83. ;
  84.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  85.         Macro
  86.         _OpenDictionary
  87.             move.w              #$0501,D0
  88.             dc.w                $AA53
  89.         EndM
  90.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  91.         IMPORT_CFM_FUNCTION OpenDictionary
  92.     ENDIF
  93.  
  94. ;
  95. ; pascal OSErr CloseDictionary(SInt32 dictionaryReference)
  96. ;
  97.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  98.         Macro
  99.         _CloseDictionary
  100.             move.w              #$0202,D0
  101.             dc.w                $AA53
  102.         EndM
  103.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  104.         IMPORT_CFM_FUNCTION CloseDictionary
  105.     ENDIF
  106.  
  107. ;
  108. ; pascal OSErr InsertRecordToDictionary(SInt32 dictionaryReference, ConstStr255Param key, Handle recordDataHandle, DictionaryDataInsertMode whichMode)
  109. ;
  110.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  111.         Macro
  112.         _InsertRecordToDictionary
  113.             move.w              #$0703,D0
  114.             dc.w                $AA53
  115.         EndM
  116.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  117.         IMPORT_CFM_FUNCTION InsertRecordToDictionary
  118.     ENDIF
  119.  
  120. ;
  121. ; pascal OSErr DeleteRecordFromDictionary(SInt32 dictionaryReference, ConstStr255Param key)
  122. ;
  123.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  124.         Macro
  125.         _DeleteRecordFromDictionary
  126.             move.w              #$0404,D0
  127.             dc.w                $AA53
  128.         EndM
  129.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  130.         IMPORT_CFM_FUNCTION DeleteRecordFromDictionary
  131.     ENDIF
  132.  
  133. ;
  134. ; pascal OSErr FindRecordInDictionary(SInt32 dictionaryReference, ConstStr255Param key, DictionaryAttributeTablePtr requestedAttributeTablePointer, Handle recordDataHandle)
  135. ;
  136.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  137.         Macro
  138.         _FindRecordInDictionary
  139.             move.w              #$0805,D0
  140.             dc.w                $AA53
  141.         EndM
  142.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  143.         IMPORT_CFM_FUNCTION FindRecordInDictionary
  144.     ENDIF
  145.  
  146. ;
  147. ; pascal OSErr FindRecordByIndexInDictionary(SInt32 dictionaryReference, SInt32 recordIndex, DictionaryAttributeTablePtr requestedAttributeTablePointer, Str255 recordKey, Handle recordDataHandle)
  148. ;
  149.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  150.         Macro
  151.         _FindRecordByIndexInDictionary
  152.             move.w              #$0A06,D0
  153.             dc.w                $AA53
  154.         EndM
  155.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  156.         IMPORT_CFM_FUNCTION FindRecordByIndexInDictionary
  157.     ENDIF
  158.  
  159. ;
  160. ; pascal OSErr GetDictionaryInformation(SInt32 dictionaryReference, DictionaryInformation *theDictionaryInformation)
  161. ;
  162.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  163.         Macro
  164.         _GetDictionaryInformation
  165.             move.w              #$0407,D0
  166.             dc.w                $AA53
  167.         EndM
  168.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  169.         IMPORT_CFM_FUNCTION GetDictionaryInformation
  170.     ENDIF
  171.  
  172. ;
  173. ; pascal OSErr CompactDictionary(SInt32 dictionaryReference)
  174. ;
  175.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  176.         Macro
  177.         _CompactDictionary
  178.             move.w              #$0208,D0
  179.             dc.w                $AA53
  180.         EndM
  181.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  182.         IMPORT_CFM_FUNCTION CompactDictionary
  183.     ENDIF
  184.  
  185.  
  186.  
  187.     ENDIF ; __DICTIONARY__ 
  188.  
  189.